styleproperty: Make parse_value() a vfunc
authorBenjamin Otte <otte@redhat.com>
Sun, 1 Jan 2012 23:45:29 +0000 (00:45 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 9 Jan 2012 17:37:53 +0000 (18:37 +0100)
gtk/gtkstyleproperty.c
gtk/gtkstylepropertyprivate.h

index de852ea3e36efaf4add25497631268c166adabd8..080e3abff4518365b0b8dfe452a5dd8c29bcb411 100644 (file)
@@ -119,6 +119,12 @@ gtk_style_property_get_property (GObject    *object,
     }
 }
 
+static gboolean
+gtk_style_property_real_parse_value (GtkStyleProperty *property,
+                                     GValue           *value,
+                                     GtkCssParser     *parser,
+                                     GFile            *base);
+
 static void
 _gtk_style_property_class_init (GtkStylePropertyClass *klass)
 {
@@ -143,6 +149,8 @@ _gtk_style_property_class_init (GtkStylePropertyClass *klass)
                                                        G_TYPE_NONE,
                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
+  klass->parse_value = gtk_style_property_real_parse_value;
+
   klass->properties = g_hash_table_new (g_str_hash, g_str_equal);
 }
 
@@ -385,10 +393,23 @@ _gtk_style_property_parse_value (GtkStyleProperty *property,
                                  GtkCssParser     *parser,
                                  GFile            *base)
 {
+  GtkStylePropertyClass *klass;
+
   g_return_val_if_fail (GTK_IS_STYLE_PROPERTY (property), FALSE);
   g_return_val_if_fail (value != NULL, FALSE);
   g_return_val_if_fail (parser != NULL, FALSE);
 
+  klass = GTK_STYLE_PROPERTY_GET_CLASS (property);
+
+  return klass->parse_value (property, value, parser, base);
+}
+
+static gboolean
+gtk_style_property_real_parse_value (GtkStyleProperty *property,
+                                     GValue           *value,
+                                     GtkCssParser     *parser,
+                                     GFile            *base)
+{
   if (_gtk_css_parser_try (parser, "initial", TRUE))
     {
       /* the initial value can be explicitly specified with the
index 73bd23fe750b97fd7c07764ee574845b941203ff..2326a0933df9742d9600e1bffa40326ca16f1510 100644 (file)
@@ -78,6 +78,10 @@ struct _GtkStylePropertyClass
                                                             GtkStateFlags           state,
                                                            GtkStylePropertyContext *context,
                                                             GValue                 *value);
+  gboolean          (* parse_value)                        (GtkStyleProperty *      property,
+                                                            GValue                 *value,
+                                                            GtkCssParser           *parser,
+                                                            GFile                  *base);
 
   GHashTable   *properties;
 };